-
-
Notifications
You must be signed in to change notification settings - Fork 18k
gtk-doc + json-glib: fix cross-compilation #117914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Does it help if I split this up? Only fixing gtk-doc and submitting the json-glib change later? |
|
I tried building some packages with these changes (native x86-64):
I guess that gives pretty good confidence this at least builds. Also built:
Note that disabling gobject-introspection has some disadvantages, e.g. python apps using pygobject won't work / compile. However, I think it's a reasonable tradeoff considering some application are able to be cross-compiled when you disable introspection, and something is more than nothing. In the future we could consider re-enabling introspection whenever we figure out how to properly cross-compile apps using introspection (see also #88222). |
jtojnar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that disabling introspection for cross is good idea for now since it makes greater range of packages build.
I think including the gtk-doc changes here is fine, as it was done in order to make json-glib cross-compile. It would be nice to add assert !isCross to gobject-introspection / python3.pkgs.pygobject3 so that the apps relying on introspection could fail fast instead of at runtime but that is probably too out of scope.
My understanding of cross-compilation is still somewhat incomplete so I am not really qualified to review that.
|
Thanks for the comments. I'll have a good look at this and will try some things to make cross-compilation happy. Indeed soms of the depsBuildBuild feel wrong, it's good to have that confirmed. |
cd76e2c to
c4bfe17
Compare
|
I've updated the PR so depsBuildBuild are not used anymore in json-glib. It appears that that was not needed / I couldn't make sense of it. Maybe it's something to look at in the future. I did have to disable strictDeps again though. It would work when I put pkg-config in depsBuildBuild, but I didn't really understand why that was needed and I couldn't really figure it out together with @Ericson2314. It doesn't seem logical to put pkg-config there, and I can't find that pattern anywhere else in nixpkgs. Somehow when I enabled strictDeps, I got an error that gobject-introspection couldn't be found anymore (even though pkg-config and gobject-introspection are both in nativeBuildInputs). |
|
It is logical to put pkg-config there too when it is needed for build time packages' pc files, and I do recommend that. |
c4bfe17 to
8e14bce
Compare
|
This is ready IMO. Let me know if there's anything still to be addressed. |
Motivation for this change
Fixes #117181.
I first thought that the patch for gtk-doc didn't make sense, but I think it does. Still have to disable building docs for json-glib, since it also uses introspection, which doesn't support cross-compilation (well).
Important for cross-compilation, since glib is used in a lot of (GUI) applications.
Please let me know if this is the right approach. I think we should disable introspection on cross-compiled packages until we have proper support for it, so we can at least get cross-compilation working for most of the system. However, I'm not 100% sure if that's the right approach. If there are objections, I'd like an explanation of why we need introspection / what it's useful for.
I'm planning on doing more fixes as I get further with cross-compiling. I've quite a lot done, but it needs tidying up and a good look before I want to send them here. Also, I'd like some feedback on this approach before pushing all of that into nixpkgs.
Cc @Ericson2314 @samueldr
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)